﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharpGenericTeach
{
    public class MyGenericClass1<T1,T2>
    {
        private T1 data1;
        private T2 data2;

        public MyGenericClass1()
        {
            //data1 = new T1(); 因为T1类型我们不确定是不是引用类型，所有不能new

            //data2 = null; 因为data2也不确定是引用类型

            data1 = default(T1); //如果T1是引用类型，则赋值为null,如果是值类型，则给对应的默认值
            data2 = default(T2);
        }
    }
}
